home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7379 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 0a | 50 61 74 68 3a 20 64 69 |.lang.c.|Path: di|
|00000020| 73 63 75 73 2e 74 65 63 | 68 6e 69 6f 6e 2e 61 63 |scus.tec|hnion.ac|
|00000030| 2e 69 6c 21 63 73 64 21 | 65 6d 69 6c 64 0a 46 72 |.il!csd!|emild.Fr|
|00000040| 6f 6d 3a 20 4b 6f 68 6e | 20 45 6d 69 6c 20 44 61 |om: Kohn| Emil Da|
|00000050| 6e 20 3c 65 6d 69 6c 64 | 40 63 73 2e 74 65 63 68 |n <emild|@cs.tech|
|00000060| 6e 69 6f 6e 2e 61 63 2e | 69 6c 3e 0a 53 75 62 6a |nion.ac.|il>.Subj|
|00000070| 65 63 74 3a 20 52 65 3a | 20 61 75 74 6f 6d 61 74 |ect: Re:| automat|
|00000080| 69 63 20 63 68 61 72 72 | 73 20 0a 43 6f 6e 74 65 |ic charr|s .Conte|
|00000090| 6e 74 2d 54 79 70 65 3a | 20 54 45 58 54 2f 50 4c |nt-Type:| TEXT/PL|
|000000a0| 41 49 4e 3b 20 63 68 61 | 72 73 65 74 3d 55 53 2d |AIN; cha|rset=US-|
|000000b0| 41 53 43 49 49 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |ASCII.Or|ganizati|
|000000c0| 6f 6e 3a 20 54 65 63 68 | 6e 69 6f 6e 2c 20 49 73 |on: Tech|nion, Is|
|000000d0| 72 61 65 6c 20 49 6e 73 | 74 69 74 75 74 65 20 6f |rael Ins|titute o|
|000000e0| 66 20 54 65 63 68 6e 6f | 6c 6f 67 79 0a 44 61 74 |f Techno|logy.Dat|
|000000f0| 65 3a 20 4d 6f 6e 2c 20 | 32 36 20 46 65 62 20 31 |e: Mon, |26 Feb 1|
|00000100| 39 39 36 20 30 30 3a 30 | 32 3a 30 36 20 47 4d 54 |996 00:0|2:06 GMT|
|00000110| 0a 4d 65 73 73 61 67 65 | 2d 49 44 3a 20 3c 50 69 |.Message|-ID: <Pi|
|00000120| 6e 65 2e 53 56 34 2e 33 | 2e 39 31 2d 68 65 62 2d |ne.SV4.3|.91-heb-|
|00000130| 32 2e 30 34 2e 39 36 30 | 32 32 36 30 31 35 36 30 |2.04.960|22601560|
|00000140| 36 2e 32 39 30 30 37 44 | 2d 31 30 30 30 30 30 40 |6.29007D|-100000@|
|00000150| 63 73 2e 74 65 63 68 6e | 69 6f 6e 2e 61 63 2e 69 |cs.techn|ion.ac.i|
|00000160| 6c 3e 0a 4d 69 6d 65 2d | 56 65 72 73 69 6f 6e 3a |l>.Mime-|Version:|
|00000170| 20 31 2e 30 0a 49 6e 2d | 52 65 70 6c 79 2d 54 6f | 1.0.In-|Reply-To|
|00000180| 3a 20 3c 34 67 6c 70 32 | 39 24 64 73 68 40 64 32 |: <4glp2|9$dsh@d2|
|00000190| 2e 74 75 66 74 73 2e 65 | 64 75 3e 20 0a 58 2d 4e |.tufts.e|du> .X-N|
|000001a0| 6e 74 70 2d 50 6f 73 74 | 69 6e 67 2d 48 6f 73 74 |ntp-Post|ing-Host|
|000001b0| 3a 20 63 73 64 2e 63 73 | 2e 74 65 63 68 6e 69 6f |: csd.cs|.technio|
|000001c0| 6e 2e 61 63 2e 69 6c 0a | 52 65 66 65 72 65 6e 63 |n.ac.il.|Referenc|
|000001d0| 65 73 3a 20 3c 34 67 6c | 70 32 39 24 64 73 68 40 |es: <4gl|p29$dsh@|
|000001e0| 64 32 2e 74 75 66 74 73 | 2e 65 64 75 3e 20 0a 53 |d2.tufts|.edu> .S|
|000001f0| 65 6e 64 65 72 3a 20 6e | 65 77 73 40 64 69 73 63 |ender: n|ews@disc|
|00000200| 75 73 2e 74 65 63 68 6e | 69 6f 6e 2e 61 63 2e 69 |us.techn|ion.ac.i|
|00000210| 6c 20 28 4e 65 77 73 20 | 73 79 73 74 65 6d 29 0a |l (News |system).|
|00000220| 58 2d 53 65 6e 64 65 72 | 3a 20 65 6d 69 6c 64 40 |X-Sender|: emild@|
|00000230| 63 73 64 0a 0a 0a 0a 4f | 6e 20 32 34 20 46 65 62 |csd....O|n 24 Feb|
|00000240| 20 31 39 39 36 2c 20 52 | 6f 62 65 72 74 6f 20 44 | 1996, R|oberto D|
|00000250| 6f 72 69 63 68 20 77 72 | 6f 74 65 3a 0a 0a 3e 20 |orich wr|ote:..> |
|00000260| 48 65 6c 6c 6f 2c 20 3e | 20 3e 20 43 6f 75 6c 64 |Hello, >| > Could|
|00000270| 20 73 6f 6d 65 6f 6e 65 | 20 65 6e 6c 69 67 68 74 | someone| enlight|
|00000280| 65 6e 20 6d 65 2c 20 61 | 6e 64 20 74 65 6c 6c 20 |en me, a|nd tell |
|00000290| 6d 65 20 77 68 79 20 74 | 68 65 20 66 6f 6c 6c 6f |me why t|he follo|
|000002a0| 77 69 6e 67 0a 70 72 6f | 67 72 61 6d 20 72 75 6e |wing.pro|gram run|
|000002b0| 73 20 3e 20 6a 75 73 74 | 20 64 61 6e 64 79 20 75 |s > just| dandy u|
|000002c0| 73 69 6e 67 20 53 75 6e | 27 73 20 63 63 20 28 33 |sing Sun|'s cc (3|
|000002d0| 2e 30 2e 31 29 2c 20 62 | 75 74 20 63 72 61 73 68 |.0.1), b|ut crash|
|000002e0| 65 73 20 75 73 69 6e 67 | 20 67 63 63 0a 28 3f 29 |es using| gcc.(?)|
|000002f0| 20 3f 20 3e 20 3e 20 23 | 69 6e 63 6c 75 64 65 20 | ? > > #|include |
|00000300| 3c 73 74 64 69 6f 2e 68 | 3e 20 3e 20 63 68 61 72 |<stdio.h|> > char|
|00000310| 20 2a 62 28 29 20 7b 20 | 72 65 74 75 72 6e 20 22 | *b() { |return "|
|00000320| 48 65 6c 6c 6f 22 3b 7d | 20 3e 20 3e 20 6d 61 69 |Hello";}| > > mai|
|00000330| 6e 28 29 20 7b 20 3e 0a | 63 68 61 72 20 2a 61 3d |n() { >.|char *a=|
|00000340| 62 28 29 3b 20 3e 20 3e | 20 61 5b 30 5d 3d 27 58 |b(); > >| a[0]='X|
|00000350| 27 3b 20 3e 20 70 72 69 | 6e 74 66 28 22 2d 2d 3e |'; > pri|ntf("-->|
|00000360| 20 25 73 5c 6e 22 2c 61 | 29 3b 20 3e 20 7d 20 3e | %s\n",a|); > } >|
|00000370| 20 3e 20 45 73 65 6e 74 | 69 61 6c 6c 79 2c 20 67 | > Esent|ially, g|
|00000380| 63 63 0a 70 75 74 73 20 | 6f 75 74 20 74 68 65 20 |cc.puts |out the |
|00000390| 66 6f 6c 6c 6f 77 69 6e | 67 20 61 73 73 65 6d 62 |followin|g assemb|
|000003a0| 6c 79 20 63 6f 64 65 3a | 20 3e 20 3e 20 63 61 6c |ly code:| > > cal|
|000003b0| 6c 20 62 2c 30 20 3e 20 | 6e 6f 70 20 3e 20 6d 6f |l b,0 > |nop > mo|
|000003c0| 76 20 38 38 2c 25 6f 31 | 20 2f 2f 0a 25 6f 31 20 |v 88,%o1| //.%o1 |
|000003d0| 3d 20 27 58 27 20 3e 20 | 73 74 62 20 25 6f 31 2c |= 'X' > |stb %o1,|
|000003e0| 20 5b 25 6f 30 5d 20 2f | 2f 20 61 5b 30 5d 20 3d | [%o0] /|/ a[0] =|
|000003f0| 20 25 6f 31 20 3e 20 3e | 20 41 6e 64 20 63 63 20 | %o1 > >| And cc |
|00000400| 73 70 69 74 73 20 6f 75 | 74 20 74 68 65 0a 66 6f |spits ou|t the.fo|
|00000410| 6c 6c 6f 77 69 6e 67 3a | 20 3e 20 3e 20 63 61 6c |llowing:| > > cal|
|00000420| 6c 20 62 20 3e 20 6e 6f | 70 20 3e 20 6d 6f 76 20 |l b > no|p > mov |
|00000430| 38 38 2c 25 6c 31 20 3e | 20 73 74 62 20 25 6c 31 |88,%l1 >| stb %l1|
|00000440| 2c 5b 25 6c 30 2b 30 5d | 20 3e 20 3e 20 28 74 68 |,[%l0+0]| > > (th|
|00000450| 69 73 0a 61 73 73 65 6d | 62 6c 79 20 63 6f 64 65 |is.assem|bly code|
|00000460| 20 68 61 73 20 62 65 65 | 6e 20 6f 70 74 69 6d 69 | has bee|n optimi|
|00000470| 7a 65 64 20 62 79 20 6d | 65 20 3a 2d 2f 20 29 20 |zed by m|e :-/ ) |
|00000480| 3e 20 3e 20 41 6e 79 77 | 61 79 2c 20 74 68 65 72 |> > Anyw|ay, ther|
|00000490| 65 20 69 73 6e 27 74 0a | 72 65 61 6c 6c 79 20 74 |e isn't.|really t|
|000004a0| 68 61 74 20 6d 75 63 68 | 20 64 69 66 66 65 72 65 |hat much| differe|
|000004b0| 6e 63 65 2e 2e 2e 20 62 | 75 74 20 49 20 67 65 74 |nce... b|ut I get|
|000004c0| 20 61 20 73 65 67 20 66 | 61 75 6c 74 20 3e 20 77 | a seg f|ault > w|
|000004d0| 69 74 68 20 67 63 63 2e | 20 20 57 68 79 3f 20 3e |ith gcc.| Why? >|
|000004e0| 20 3e 0a 54 68 61 6e 6b | 73 21 20 3e 20 3e 20 52 | >.Thank|s! > > R|
|000004f0| 6f 62 65 72 74 6f 20 3e | 20 3e 20 2d 2d 20 3e 20 |oberto >| > -- > |
|00000500| 3e 20 52 6f 62 65 72 74 | 6f 20 44 6f 72 69 63 68 |> Robert|o Dorich|
|00000510| 20 6f 20 53 4b 49 20 72 | 64 6f 72 69 63 68 40 65 | o SKI r|dorich@e|
|00000520| 65 2e 63 6f 72 6e 65 6c | 6c 2e 65 64 75 0a 3e 20 |e.cornel|l.edu.> |
|00000530| 45 6c 65 63 74 72 69 63 | 61 6c 20 45 6e 67 69 6e |Electric|al Engin|
|00000540| 65 65 72 69 6e 67 20 2f | 3d 20 45 58 54 52 45 4d |eering /|= EXTREM|
|00000550| 45 20 72 64 6f 72 69 63 | 68 40 74 75 66 74 73 2e |E rdoric|h@tufts.|
|00000560| 65 64 75 20 3e 20 43 6f | 72 6e 65 6c 6c 20 55 6e |edu > Co|rnell Un|
|00000570| 69 76 65 72 73 69 74 79 | 0a 5f 5f 2f 5f 5f 2c 20 |iversity|.__/__, |
|00000580| 64 6f 72 69 63 68 40 70 | 74 63 2e 63 6f 6d 20 3e |dorich@p|tc.com >|
|00000590| 0a 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.-------|--------|
|000005a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000005d0| 2d 2d 2d 2d 2d 2d 2d 20 | 3e 20 3e 0a 41 4e 53 49 |------- |> >.ANSI|
|000005e0| 20 43 20 73 74 61 74 65 | 73 20 74 68 61 74 20 74 | C state|s that t|
|000005f0| 68 65 20 63 6f 6d 70 69 | 6c 65 72 20 6d 61 79 20 |he compi|ler may |
|00000600| 73 74 6f 72 65 20 73 74 | 72 69 6e 67 20 63 6f 6e |store st|ring con|
|00000610| 73 74 61 6e 74 73 20 69 | 6e 20 72 65 61 64 2d 6f |stants i|n read-o|
|00000620| 6e 6c 79 0a 6d 65 6d 6f | 72 79 20 61 72 65 61 73 |nly.memo|ry areas|
|00000630| 2e 20 54 68 65 20 66 69 | 72 73 74 20 63 6f 6d 70 |. The fi|rst comp|
|00000640| 69 6c 65 72 20 64 6f 65 | 73 6e 27 74 20 64 6f 20 |iler doe|sn't do |
|00000650| 74 68 69 73 2c 20 74 68 | 65 20 73 65 63 6f 6e 64 |this, th|e second|
|00000660| 20 64 6f 65 73 2e 20 59 | 6f 75 20 67 65 74 0a 61 | does. Y|ou get.a|
|00000670| 20 6d 65 6d 6f 72 79 20 | 66 61 75 6c 74 2c 20 69 | memory |fault, i|
|00000680| 6e 20 74 68 65 20 73 65 | 63 6f 6e 64 20 63 61 73 |n the se|cond cas|
|00000690| 65 2c 20 20 77 68 65 6e | 20 79 6f 75 20 74 72 79 |e, when| you try|
|000006a0| 20 74 6f 20 6f 76 65 72 | 77 72 69 74 65 20 74 68 | to over|write th|
|000006b0| 65 20 73 74 72 69 6e 67 | 20 0a 63 6f 6e 73 74 61 |e string| .consta|
|000006c0| 6e 74 2e 20 53 6f 20 74 | 68 65 20 6d 61 69 6e 20 |nt. So t|he main |
|000006d0| 70 72 6f 62 6c 65 6d 20 | 69 73 20 57 48 45 52 45 |problem |is WHERE|
|000006e0| 20 22 48 65 6c 6c 6f 22 | 20 49 53 20 53 54 4f 52 | "Hello"| IS STOR|
|000006f0| 45 44 2c 20 28 69 6e 20 | 61 20 72 65 61 64 2d 6f |ED, (in |a read-o|
|00000700| 6e 6c 79 20 0a 6f 72 20 | 61 20 77 72 69 74 65 61 |nly .or |a writea|
|00000710| 62 6c 65 20 6d 65 6d 6f | 72 79 20 61 72 65 61 29 |ble memo|ry area)|
|00000720| 2c 20 61 6e 64 20 61 6c | 74 68 6f 75 67 68 20 74 |, and al|though t|
|00000730| 68 65 20 61 73 73 65 6d | 62 6c 79 20 63 6f 64 65 |he assem|bly code|
|00000740| 73 20 61 72 65 20 73 69 | 6d 69 6c 61 72 2c 20 0a |s are si|milar, .|
|00000750| 74 68 65 20 62 65 68 61 | 76 69 6f 72 20 69 73 20 |the beha|vior is |
|00000760| 64 69 66 66 65 72 65 6e | 74 2e 0a 0a 48 6f 70 65 |differen|t...Hope|
|00000770| 20 74 68 69 73 20 68 65 | 6c 70 73 2e 0a 0a 09 09 | this he|lps.....|
|00000780| 09 09 09 09 09 52 65 67 | 61 72 64 73 2c 0a 0a 09 |.....Reg|ards,...|
|00000790| 09 09 09 09 09 09 09 45 | 6d 69 6c 0a 0a 0a |.......E|mil... |
+--------+-------------------------+-------------------------+--------+--------+